/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package assignment_cp3120.administrator.deletemanager;

import assignment_cp3120.DAO.Factory.DAOFactory;
import assignment_cp3120.dataObjects.User;
import assignment_cp3120.user.deleteUser.DeleteUserModel;

/**
 *
 * @author Administrator
 */
public class DeleteManagerModel extends DeleteUserModel { 
    
    private User tempUser;

    public DeleteManagerModel() {
        tempUser = new User();
    }
    
    public boolean validate(String username) {
        tempUser = DAOFactory.getDAOFactory().getUserDAO().getUser(username);
        if (tempUser != null){
            return true;
        }
        return false;
    }
    public boolean managerIsManager(){
        return tempUser.isManager();
    }
    @Override public void deleteUser() {
        DAOFactory.getDAOFactory().getUserDAO().deleteUser(tempUser.getUsername());
    }
}
